ihelpuoo.namespace("ihelpuoo.widget.flag");

var ihelpuoo_widget_flag_loading = null; 

ihelpuoo.loader = function()
{
	if(!ihelpuoo_widget_flag_loading)
		ihelpuoo_widget_flag_loading = new ihelpuoo.widget.flag.LoadingView();
	return ihelpuoo_widget_flag_loading;
}

ihelpuoo.widget.flag.LoadingView = function()
{
}

ihelpuoo.widget.flag.LoadingView.prototype
=
{
	draw : function()
	{
		if(!this.shell)
		{
			this.shell = document.createElement("DIV");
			this.shell.className = "loading_shell";
			this.oIcon = document.createElement("IMG");
			this.oIcon.className="icon16";
			this.oIcon.src = ihelpuoo.http.server().icon("loading.gif","weboo");
			this.oMsg = document.createElement("SPAN");
			this.oMsg.className = "loading_text";
			var msg = document.body.getAttribute("msg-loading");
			if(ihelpuoo.isBlank(msg))
				msg = "Loading...";
			this.oMsg.innerHTML = msg;
			this.shell.appendChild(this.oIcon);
			this.shell.appendChild(this.oMsg);
			document.body.appendChild(this.shell);
		}
		ihelpuoo.widget.GC.moveToLeftTop(this.shell,document.body);
		this.shell.style.display = "block";
	}
	
	,
	hide: function()
	{
		this.shell.style.display = "none";
	}
	
}

